package com.momo.seckilling.dao;

import com.momo.seckilling.entity.ProductInfo;
import com.momo.seckilling.mapper.ProductInfoMapper;
import com.momo.seckilling.vo.ProductInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by li on 2019/2/2.
 */
@Component
public class ProductInfoDao {

    @Autowired
    private ProductInfoMapper productInfoMapper;

    public void saveProductInfo(ProductInfo productInfo){
        productInfoMapper.saveProductInfo(productInfo);
    }
    public List<ProductInfo> listProductInfo(ProductInfoVo productInfoVo){
        return productInfoMapper.listProductInfo(productInfoVo);
    }

    public void updateProductInfo(ProductInfo productInfo){
        productInfoMapper.updateProductInfo(productInfo);
    }

    public ProductInfo findProductById(int id){
        return productInfoMapper.findProductById(id);
    }

}
